package com.atguigu.common.exception;

/**
 * 自定义异常码
 *
 * @author DuGuanghan
 * @since 2024-01-08 15:59:13
 */
public enum BizCodeException {
    /**
     * 异常校验码
     */
    UNKNOW_EXCEPTION(10000, "系统未知异常"),
    VALID_EXCEPTION(10001, "参数格式校验失败"),
    PRODUCT_UP_EXCEPTION(10002, "商品上架失败"),
    SMS_SEND_TIMEOUT(10002, "短信验证码发送频繁，请稍后重试"),
    USERNAME_EXIT_EXCEPTION(15001, "用户名已存在"),
    PHONE_EXIT_EXCEPTION(15001, "手机号已存在"),
    LOGIN_ERROR_EXCEPTION(15002, "用户名或密码不正确");

    private Integer code;
    private String msg;

    BizCodeException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
